home *** CD-ROM | disk | FTP | other *** search
- # Source Generated with Decompyle++
- # File: in.pyc (Python 2.6)
-
- import xml.sax as xml
- import xml.sax.handler as xml
-
- class BuyAlbumHandler(xml.sax.handler.ContentHandler):
- format_map = {
- 'ogg': 'URL_OGGZIP',
- 'flac': 'URL_FLACZIP',
- 'wav': 'URL_WAVZIP',
- 'mp3-cbr': 'URL_128KMP3ZIP',
- 'mp3-vbr': 'URL_VBRZIP' }
-
- def __init__(self, format):
- xml.sax.handler.ContentHandler.__init__(self)
- self._format_tag = self.format_map[format]
-
-
- def startElement(self, name, attrs):
- self._text = ''
-
-
- def endElement(self, name):
- if name == 'ERROR':
- raise MagnatunePurchaseError(self._text)
- name == 'ERROR'
- if name == 'DL_USERNAME':
- self.username = self._text
- elif name == 'DL_PASSWORD':
- self.password = self._text
- elif name == self._format_tag:
- self.url = self._text
-
-
-
- def characters(self, content):
- self._text = self._text + content
-
-
-
- class MagnatunePurchaseError(Exception):
- pass
-
-